package com.gree.fms.processor.constants;

import com.gree.fms.processor.exceptions.ConfigInitException;
import com.gree.fms.processor.annotations.RocketMQMessageListenerExpand;
import com.gree.fms.processor.annotations.TemplateBean;
import com.gree.fms.processor.convertors.ClassInstanceConvertor;
import com.gree.fms.processor.interfaces.IExpand;

/**
 * @author joyce
 */
public class ClassRefConstant {

    public final static String TEMPLATE_NAME = "com.gree.fms.processor.annotations.TemplateBean";

    public final static String INTERFACE_EXPAND_NAME = "com.gree.fms.processor.interfaces.IExpand";

    public final static String ANNOTATION_EXPAND_NAME = "com.gree.fms.processor.annotations.RocketMQMessageListenerExpand";
    public final static String CONVERTER_NAME = "com.gree.fms.processor.convertors.ClassInstanceConvertor";


    public final static String CONSUME_MODE = "org.apache.rocketmq.spring.annotation.ConsumeMode";
    public final static String MESSAGE_MODE = "org.apache.rocketmq.spring.annotation.MessageModel";
    public final static String SELECTOR_TYPE = "org.apache.rocketmq.spring.annotation.SelectorType";
    public final static String RMQ_MESSAGE_LISTENER = "org.apache.rocketmq.spring.annotation.RocketMQMessageListener";

    static {
        if (!TemplateBean.class.getName().equals(TEMPLATE_NAME)) {
            throw new ConfigInitException("TemplateBean class path error!");
        }

        if (!IExpand.class.getName().equals(TEMPLATE_NAME)) {
            throw new ConfigInitException("IExpand class path error!");
        }

        if (!RocketMQMessageListenerExpand.class.getName().equals(TEMPLATE_NAME)) {
            throw new ConfigInitException("RocketMQMessageListenerExpand class path error!");
        }

        if (!ClassInstanceConvertor.class.getName().equals(CONVERTER_NAME)) {
            throw new ConfigInitException("ExpandToMessageListenerConvertor class path error!");
        }
    }

}
